If the resident source is destroyed, it should be recreated
immediately, so that it is available when another volume is
mounted. However, we only connect to the 'destroy' signal
on the original source, not on newly created ones. As a result,
the resident source only works twice, after that it shows up
without icon and an empty notification.
Fix by always connecting to the source's 'destroy' signal.
this._onMountRemoved));
this._transDispatcher = new AutorunTransientDispatcher();
- this._residentSource = new AutorunResidentSource();
- this._residentSource.connect('destroy', Lang.bind(this,
- function() {
- this._residentSource = new AutorunResidentSource();
- }));
+ this._createResidentSource();
let mounts = this._volumeMonitor.get_mounts();
}));
},
+ _createResidentSource: function() {
+ this._residentSource = new AutorunResidentSource();
+ this._residentSource.connect('destroy',
+ Lang.bind(this,
+ this._createResidentSource));
+ },
+
_onMountAdded: function(monitor, mount) {
// don't do anything if our session is not the currently
// active one